package cn.wolfcode.enums;

import lombok.Getter;

/**
 * Author wyy
 * Date 2021/1/14 11:21
 **/
@Getter
public enum ConsumptionEnum {
    //待结算
    COUNT("待结算",0),
    //待审核
    CHECK("待审核",1),
    //归档
    PIGEONHOLE("归档",2),
    //坏账
    BADACCOUNT("坏账",3);

    private final String name;
    private final Integer value;

    ConsumptionEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findStatusName(Integer status) {
        ConsumptionEnum[] enums = ConsumptionEnum.values();
        for (ConsumptionEnum anEnum : enums) {
            if(status.equals(anEnum.getValue())){
                return anEnum.getName();
            }
        }
        return null;
    }
}
